//
//

//==================== YES 登录/NO 为登录=======================

#define ISLOGIN [Config fetchLogin]

//====================获取Window=======================

#define kWindow [UIApplication sharedApplication].keyWindow

//====================屏幕的宽 高 导航栏的高和tab栏的高=======================

#define kBarHigh 49
#define kNavHigh 64

#define kScreenWidth ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height)

#define kScreenHigh ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.height : [[UIScreen mainScreen] bounds].size.width)



//==================== 多线程GCD ======================
#define kGCDGlobal(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block)

#define kGCDMain(block) dispatch_async(dispatch_get_main_queue(),block)

#define kGCDMainTime(time,block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), block)

//====================版本号CFBundleShortVersionString======================
#define kVersion        [ConfigTest fetchVersion]   ///在需要版本号的地方调用
#define kVersionPublic  @"1.0.0" ///对外公布版本 默认初始值 正式不可变  测试版是可变的 不做使用
#define kVersionBundle  [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]

//====================懒人简化书写宏======================
///弱引用
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
///快速提示
#define kAlertShow(aMessage) UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:aMessage delegate:nil cancelButtonTitle:@"确认" otherButtonTitles:nil];[alert show]

#define kXBProgressHUD(aMessage) [XBProgressHUD showProgressHUDWithText:aMessage]


//==================== 字符串 ======================

#define kStringValue(object) [NSString stringWithFormat:@"%@",object]
#define kStringFormat(format,...) [NSString stringWithFormat:format, ##__VA_ARGS__]
#define kStringNum(num) [NSString stringWithFormat:@"%ld",num]
#define kStringInteger(integer) [NSString stringWithFormat:@"%zi",integer]
#define kStringFloat(float) [NSString stringWithFormat:@"%.2lf",float]
///年月日的
#define kStringData(float) [NSString stringWithFormat:@"%02ld",float]

//==================== 字符串 定义UIImage对象 ======================
#define kImageName(imageName) [UIImage imageNamed:imageName]
#define kImageURL(imageName)   [NSURL URLWithString:imageName]
#define kImagePlaceholderDefault [UIImage imageNamed:@"PlaceholderDefault"]


//===================请求提示文字======================

//#define Loading @"请稍后..."
//#define Request_Failure @"失败"
//#define Request_Success @"成功"
//#define Request_NOMore @"已加载全部"

//====================iPhone or iPad======================

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_PAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)


//====================NSLog======================

#if DEBUG

#define DLog(FORMAT, ...) fprintf(stderr,"\nfunction:%s line:%d content:%s\n", __FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else

#define DLog(FORMAT, ...) nil

#endif











